var t = require("../../@babel/runtime/helpers/defineProperty"),
  e = o(require("../../@babel/runtime/regenerator")),
  a = require("../../@babel/runtime/helpers/asyncToGenerator"),
  r = require("./util/index"),
  i = o(require("@/config/index")),
  n = o(require("@/libs/lodash"));
function o(t) {
  return t && t.__esModule ? t : { default: t };
}
Component({
  properties: { html: { type: String, default: "" } },
  data: {
    isShowVideoBtn: !0,
    controls: !1,
    htmlStr: "",
    CDN: i.default.CDN,
    nodes: [],
    curCollect: -1,
    isStopAnimation: !0,
    duration: "",
  },
  ready: function () {
    var t = this;
    return a(
      e.default.mark(function a() {
        return e.default.wrap(function (e) {
          for (;;)
            switch ((e.prev = e.next)) {
              case 0:
                t.initData();
              case 1:
              case "end":
                return e.stop();
            }
        }, a);
      }),
    )();
  },
  methods: {
    initData: function () {
      var t = this;
      this.properties
        ? this.setData({
            htmlStr: this.properties.html,
            nodes: (0, r.getDomContent)(this.properties.html),
          })
        : setTimeout(function () {
            t.initData();
          }, 300);
    },
    handlePlayVideo: function (t) {
      wx.createVideoContext(t.id, this).play();
    },
    bindplay: function (e) {
      for (var a = 0; a < this.data.nodes.length; a++) {
        var r = this.data.nodes[a];
        if (
          n.default.get(r, "val.id") === n.default.get(e.currentTarget, "id")
        ) {
          this.setData(t({}, "nodes[".concat(a, "].val.statePlay"), !0));
          break;
        }
      }
    },
    bindpause: function (e) {
      for (var a = 0; a < this.data.nodes.length; a++) {
        var r = this.data.nodes[a];
        if (
          n.default.get(r, "val.id") === n.default.get(e.currentTarget, "id")
        ) {
          this.setData(t({}, "nodes[".concat(a, "].val.statePlay"), !1));
          break;
        }
      }
    },
  },
});
